//
//  RDNavigatorViewController.swift
//  test-ios
//
//  Created by wyz5204 on 2023/7/26.
//

import Foundation
import UIKit


class RDNavigatorViewController : UINavigationController {
    
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        if (self.viewControllers.count > 0) {
            viewController.hidesBottomBarWhenPushed = true;
        }
        super.pushViewController(viewController, animated: animated)
    }
    
    override func popToRootViewController(animated: Bool) -> [UIViewController]? {
        if (self.viewControllers.count > 1) {
            self.topViewController?.hidesBottomBarWhenPushed = false
        }
        return super.popToRootViewController(animated: animated)
    }
}
